<?php
	require_once($_SERVER['DOCUMENT_ROOT'].'uno-course-scheduler/include/config.inc.php');
	require_once($_SERVER['DOCUMENT_ROOT'].'uno-course-scheduler/include/top.inc.php');


$mapping_id = $_GET['id'];


$get_bname = "SELECT * FROM buildings b JOIN building_subject_mapping bsm ON bsm.building_id = b.id WHERE bsm.id='$mapping_id'";
$result_bname = mysql_query($get_bname);
$building_name = mysql_result($result_bname,0,"building_name");

$get_sname = "SELECT * FROM course_subjects cs JOIN building_subject_mapping bsm ON bsm.course_subject_id = cs.id WHERE bsm.id='$mapping_id'";
$result_sname = mysql_query($get_sname);
$subject_name = mysql_result($result_sname,0,"subject_title");
$subject_id = mysql_result($result_sname,0,"course_subject_id");

echo "<p>";
	echo "<a href='index.php?id=$subject_id'>&lt;&lt; Back to Subject/Building Mapping Portal</a><br />";
echo "</p>";

echo "<h1>Delete Subject/Building Mapping for $subject_name</h1>";

//close
mysql_close();

echo "<p>";
echo "Are you sure you want to delete subject to building mapping between <b>$subject_name</b> and <b>$building_name</b>?</p>";

echo "<form method='post' action='delete_do.php'>";
	echo "<input type='hidden' name='id' value='$mapping_id'>";
	echo "<p><input type='Submit' value='Yes'></p>";
echo "</form>";




?>
<?php
	require_once($_SERVER['DOCUMENT_ROOT'].'uno-course-scheduler/include/bottom.inc.php');
?>